﻿#region using statements

using Microsoft.Xna.Framework;

#endregion

namespace NGen.Managers.Pathfinding
{
	public interface IManagerPathfinding
	{
		/// <summary>
		/// 	<para>Get or set the number of columns</para>
		/// </summary>
		int NumColumns { get; set; }

		/// <summary>
		/// 	<para>Get or set the number of rows</para>
		/// </summary>
		int NumRows { get; set; }

		/// <summary>
		/// 	Get or set the cost to move to adjacent cells. Non-positive
		/// 	values will cause incorrect paths.
		/// </summary>
		double AdjacentMoveCost { get; set; }

		/// <summary>
		/// 	Get or set the cost to move to diagonal squares.
		/// 	(0 to disable diagonal movement)
		/// </summary>
		double DiagonalMoveCost { get; set; }

		/// <summary>
		/// 	Should this manager maintain a closed list. Better performance when
		/// 	this value is false
		/// </summary>
		bool MaintainClosedList { get; set; }

		/// <summary>
		/// 	Gets the closed list of the last pathfinding attempt
		/// </summary>
		PathfindingCell[] ClosedList { get; }

		/// <summary>
		/// 	Gets the open list of the last pathfinding attempt
		/// </summary>
		PathfindingCell[] OpenList { get; }

		/// <summary>
		/// 	<para>Get or set the 2d Array containing the map layout, used to
		/// 		determine if a cell is passable.</para>
		/// 	<para>true if passable, false if not</para>
		/// </summary>
		bool[,] GridLayout { get; set; }

		/// <summary>
		///		<para>get or set the cost multiplier of passing through each specific cell.</para>
		///		<para>set to null for uniform costs.</para>
		/// </summary>
		float[,] CellCostsMultiplier { get; set; }

		/// <summary>
		/// 	Set pathfinding parameters
		/// </summary>
		/// <param name = "p_numColumns">number of rows</param>
		/// <param name = "p_numRows">number of columns</param>
		/// <param name = "p_adjMoveCost">adjacent move cost, must be positive</param>
		/// <param name = "p_diagMoveCost">diagonal move cost. must be positive, or
		/// 	0 to disable diagonal movement, or negative to have it 
		/// 	calculated to be in proportion to the adjacent move cost</param>
		/// <param name = "p_passableCellMap">array containing the true/false values to 
		/// 	determine if a cell is passable. true for passable, false for 
		/// 	impassable</param>
		void SetParams(int p_numColumns, int p_numRows, double p_adjMoveCost, double p_diagMoveCost, bool[,] p_passableCellMap);

		/// <summary>
		/// 	Returns an array of Points which contain the optimal path
		/// 	from the start to the finish. An array of 0 elements is returned
		/// 	if no path can be found
		/// </summary>
		/// <param name = "p_startLocation">location to start searching</param>
		/// <param name = "p_endLocation">location to end searching</param>
		/// <returns>the array containing the coordinates of the optimal path
		/// </returns>
		Point[] FindPath(Point p_startLocation, Point p_endLocation);
	}
}